<?php
try{
?>
<div id="pagination">
	<div id="quickpages">
  		<span>Chuyển nhanh:</span><select onchange="changePage(this.value);">
  		<?php
  		 foreach ($this->pagesInRange as $page){
  		 	if($page == $this->current)
   				echo "<option value='".$page."' selected='selected'>".$page."</option>";
			else echo "<option value='".$page."'>".$page."</option>";

   		}
  		?>
  		</select>
  		<script type="text/javascript">
  		function changePage(page){
  	  		var url = location.href;
  	  		var reg = new RegExp("p[0-9]+");
  	  		if(reg.test(url)) url = url.replace(reg, "p"+page);
  	  		location.href=url;
  		}
  		</script>
	</div>
	<div id="pages">
		<span>Trang: </span>
<?php
    if (isset($this->previous)){
         	echo "<a href='".$this->url(array(
                                              'page'=>'p'.$this->previous,
                                              
                                              ),
                                        'news_view')
         		."'>[Trước]</a>";

    }
    foreach ($this->pagesInRange as $page){

    		if ($page != $this->current){
	        	echo  "<a href='".$this->url(array(
                                            'page'=>'p'.$page,
                                            ),
                                      'news_view')
						."'>[" . $page . "]</a>";
		   	}else{
		        echo "<span class='current'>[".$page . "]</span>";
		    }

   	}
	if (isset($this->next)){

   			echo "<a href='".$this->url(array(
                                                  'page'=>'p'.$this->next
                                                  ),
                                            'news_view')
			."'>[Sau]</a>";
   }
  ?>
	</div>
</div>
<?php
}  catch (Exception $ex){
    echo $ex->getTraceAsString();
}
?>